<?php

namespace App\Models\Task\SnapTasks\Repositories\Interfaces;

use App\Models\Task\SnapTaskAssist\AcceleratorPack;
use App\Models\Task\SnapTasks\SnapTask;
use Illuminate\Support\Collection;

interface SnapTaskRepositoryInterface
{
    /**
     * 计数
     * @param array $param
     * @return int
     */
    public function countTask(array $param = []): int;

    public function addTask(array $task_data): SnapTask;

    public function getTaskShowInfo(SnapTask $task_info): array;

    public function findOneByTaskId(string $taskId): SnapTask;

    public function findOneByTripId(string $tripId): ?SnapTask;

    public function listSnappingTask(): Collection;

    /**
     * 更新抢票加速等级
     *
     * @param SnapTask $task
     * @param int      $level
     *

     */
    public function updateTaskSnapLevel(SnapTask $task, int $level): bool;


    public function updateTaskSnapAssistCountAndLevelBySelfPacks(SnapTask $task, int $self_assist_count): bool;

    /**
     * 更新自动出票 开关状态
     *
     * @param SnapTask $task
     * @param int      $state
     *
     */
    public function updateAutomaticTicketState(SnapTask $task, int $state): bool;

    public function updateTask(SnapTask $task, array $param): bool;

    /**
     * 取消任务
     *
     * @param SnapTask $task
     *
     */
    public function cancelTask(SnapTask $task): bool;

    public function stopTask(SnapTask $task): bool;

    public function userAssist(SnapTask $task, AcceleratorPack $pack);

    public function getStopAt(SnapTask $task): string;
}